-
Notifications
You must be signed in to change notification settings - Fork 500
[CMAKE] Set the project version through the cmake project macro #3605
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[CMAKE] Set the project version through the cmake project macro #3605
Conversation
…ndard config mode to find the project in the config.cmake file. Set cached variables for the version and abi number for in-tree builds with fetch content. Test the cached varaibles are set properly in ci
✅ Deploy Preview for opentelemetry-cpp-api-docs canceled.
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3605 +/- ##
=======================================
Coverage 90.03% 90.03%
=======================================
Files 220 220
Lines 7069 7069
=======================================
Hits 6364 6364
Misses 705 705 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the fix.
See comments, with some simplifications.
…explicitly. Add support to set a version suffix string
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks for the fix.
The cmake
projectmacro takesVERSIONandLANGUAGEargs which are not currently being set in otel-cppCMakeLists.txt.CMake uses the
VERSIONarg to set internal variables (See https://cmake.org/cmake/help/v3.31/command/project.html#options) which are used by CMake. One example is for providing more info to the user when they callfind_package(opentelemetry-cpp CONFIG).Previous cmake message when calling
find_package(opentelemetry-cpp CONFIG)New cmake message when calling
find_package(opentelemetry-cpp CONFIG)Changes
OPENTELEMETRY_VERSIONandOPENTELEMETRY_ABI_VERSION_NOvariables tocmake/version.cmakeVERSIONandLANGUAGEargs inproject(opentelemetry-cpp ...)OPENTELEMETRY_VERSIONandOPENTELEMETRY_ABI_VERSION_NOas cached variables so users building otel-cpp in-tree with their project can know what version and abi number has been built.For significant contributions please make sure you have completed the following items:
CHANGELOG.mdupdated for non-trivial changes